<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
 <link href="th/houtai/assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="th/houtai/css/style.css"/>
        <link href="th/houtai/assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="th/houtai/assets/css/ace.min.css" />
        <link rel="stylesheet" href="th/houtai/font/css/font-awesome.min.css" />
        <!--[if lte IE 8]>
    <link rel="stylesheet" href="th/houtai/assets/css/ace-ie.min.css"/>
    <![endif]-->
		<script src="th/houtai/js/jquery-1.9.1.min.js"></script>
        <script src="th/houtai/assets/js/bootstrap.min.js"></script>
		<script src="th/houtai/assets/js/typeahead-bs2.min.js"></script>
		<script src="th/houtai/assets/js/jquery.dataTables.min.js"></script>
		<script src="th/houtai/assets/js/jquery.dataTables.bootstrap.js"></script>
        <script src="th/houtai/assets/layer/layer.js" type="text/javascript" ></script>
        <script src="th/houtai/assets/laydate/laydate.js" type="text/javascript"></script>
        <script src="th/houtai/js/lrtk.js" type="text/javascript" ></script>
<title>订单处理</title>
</head>

<body>
<div class="clearfix">
 <div class="handling_style" id="order_hand">
      <div id="scrollsidebar" class="left_Treeview">
        <div class="show_btn" id="rightArrow"><span></span></div>
        <div class="widget-box side_content" >
         <div class="side_title"><a title="隐藏" class="close_btn"><span></span></a></div>
         <div class="side_list"><div class="widget-header header-color-green2"><h4 class="lighter smaller">订单操作</h4></div>
         <div class="widget-body">
          <ul class="b_P_Sort_list">
             <li ><i class="orange  fa fa-reorder"></i><a href="wlcGetOrderForm" th:text="'全部订单('+${zLong}+')'">全部订单(235)</a></li>
             <li th:each="ordertypeManage:${ordertypeManageList}"><i class="fa fa-sticky-note pink "></i> <a th:href="@{wlcGetOrderForm_off_the_stocks(orderOther4 = ${ordertypeManage.orderOrdertypeManageId})}" th:text="${ordertypeManage.orderOrdertypeManageName}+'('+${ordertypeManage.num}+')'">已完成(235)</a></li>
            </ul>
        </div>
       </div>
      </div>  
     </div>
 <div class="order_list_style" id="order_list_style">
  <div class="search_style">
      <form action="wlcGetOrderForm_off_the_stocks" method="post" id="form1">
          <ul class="search_content clearfix">
              <li><label class="l_f">订单编号</label><input name="orderId" type="text"  class="text_add" placeholder="输入订单编号"  style=" width:250px" th:value="${orderId}"/></li>
              <li><label class="l_f">交易时间</label><input name="placeTime" class="inline laydate-icon" th:value="${placeTime}" id="start" style=" margin-left:10px;  "><input type="hidden" name="orderOther4" th:value="${orderOther4}"/></li>
              <li style="width:90px;"><button type="submit"  class="btn_search"><i class="fa fa-search"></i>查询</button></li>
          </ul>
      </form>
     

    </div>
    <!--交易订单列表-->
    <div class="Orderform_list" id="div1" th:fragment="div1">
       <table class="table table-striped table-bordered table-hover" id="sample-table">
		<thead>
		 <tr>
				<th width="25px"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th>
				<th width="120px">订单编号</th>
                <th width="250px">产品名称</th>
				<th width="100px">交易金额</th>				
                <th width="100px">交易时间</th>
                <th width="80px">数量</th>
				<th width="70px">状态</th>
                <th width="100px">说明</th>                
				<th width="200px">操作</th>
			</tr>
		</thead>
	<tbody>
   <tr th:each="orderOrder:${pageInfo.list}">
     <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
     <td th:text="${orderOrder.orderId}">20160705445622</td>
       <td class="order_product_name">
           <a href="#" class="product_Display"><img th:src="${orderOrder.orderOther2}"  title="产品名称"/>

       </td>
     <td th:text="${orderOrder.orderTotal/100.00}">456.5</td>
     
     <td th:text="${#dates.format(orderOrder.placeTime,'yyyy-MM-dd')}">2016-7-5</td>

     <td th:text="${orderOrder.shoppingNum}">2</td>
      <td class="td-status"><span class="label label-success radius" th:text="${orderOrder.orderOrdertypeManage.orderOrdertypeManageName}">代发货</span></td>
      <td th:text="${orderOrder.orderOrdertypeManage.orderOrdertypeManageMsg}"></td>
     <td>
     <a th:onClick="'Delivery_stop(this,\''+${orderOrder.orderId}+'\')'"  href="javascript:;" th:if="${orderOrder.orderOther4 == 3}" title="发货"  class="btn btn-xs btn-success"><i class="fa fa-cubes bigger-120"></i></a>
     <a title="订单详细"  th:href="@{wlcOrderDetailed(orderId = ${orderOrder.orderId},pageNo = ${pageNo})}"  class="btn btn-xs btn-info order_detailed" ><i class="fa fa-list bigger-120"></i></a>
     <a th:if="${orderOrder.orderOther4 == 1 or orderOrder.orderOther4 == 5}" title="删除" href="javascript:;"  th:onclick="'doDelete(\''+${orderOrder.orderId}+'\','+${pageInfo.pageNum}+','+${orderOther4}+')'" class="btn btn-xs btn-warning" ><i class="fa fa-trash  bigger-120"></i></a>
     </td>
     </tr>
    </tbody>
    </table>

        <div class="clearfix">
            <input type="hidden" id="orderId" th:value="${orderId}"/>
            <input type="hidden" id="placeTime" th:value="${placeTime}" />
            <ul class="pagination m-b-5 pull-right">
                <li th:if="${pageInfo.hasPreviousPage}"><a
                        th:href="'javascript:doPage('+${pageInfo.prePage}+','+${orderOther4}+')'"
                        aria-label="Previous"> &nbsp;上一页
                </a></li>

                <th:block th:each="nav : ${pageInfo.navigatepageNums}">
                    <li th:class="${nav==pageInfo.pageNum}?'active':''"><a
                            th:href="'javascript:doPage('+${nav}+','+${orderOther4}+')'"
                            th:text="${nav}"></a></li>
                </th:block>

                <th:block th:if="${pageInfo.hasNextPage}">
                    <li><a
                            th:href="'javascript:doPage('+${pageInfo.nextPage}+','+${orderOther4}+')'"
                            aria-label="Next"> 下一页&nbsp;
                    </a></li>
                </th:block>

                <li><span th:text="'共'+${pageInfo.pages}+'页'"></span></li>
            </ul>
        </div>



    </div>
 </div>
 </div>
</div>
<!--发货-->
 <div id="Delivery_stop" style=" display:none">
  <div class="">
    <div class="content_style">
  <div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1">快递公司 </label>
       <div class="col-sm-9"><select class="form-control"  id="logisticstypeId">
																<option value="0">--选择快递--</option>
																<option th:each="logisticstype:${logisticstypeList}" th:value="${logisticstype.logisticstypeId}" th:text="${logisticstype.logisticstypeName}">天天快递</option>
															</select></div>
	</div>
   <div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 快递号 </label>
    <div class="col-sm-9"><input type="text" id="form-field-1" placeholder="快递号" class="col-xs-10 col-sm-5" style="margin-left:0px;"></div>
	</div>

 </div>
  </div>
 </div>
</body>
</html>
<script>
$(function() { 
	$("#order_hand").fix({
		float : 'left',
		//minStatue : true,
		skin : 'green',	
		durationTime :false,
		spacingw:30,//设置隐藏时的距离
	    spacingh:250,//设置显示时间距
		table_menu:'.order_list_style',
	});
});


//时间
 laydate({
    elem: '#start',
    event: 'focus' 
});
//初始化宽度、高度  
 $(".widget-box").height($(window).height()); 
$(".order_list_style").width($(window).width()-220);
 $(".order_list_style").height($(window).height()-30);
  //当文档窗口发生改变时 触发  
    $(window).resize(function(){
	$(".widget-box").height($(window).height());
	 $(".order_list_style").width($(window).width()-234);
	  $(".order_list_style").height($(window).height()-30);
});
/**发货**/
function Delivery_stop(obj,id){
	layer.open({
        type: 1,
        title: '发货',
		maxmin: true, 
		shadeClose:false,
        area : ['500px' , ''],
        content:$('#Delivery_stop'),
		btn:['确定','取消'],
		yes: function(index, layero){		
		if($('#form-field-1').val()==""){
			layer.alert('快递号不能为空！',{
               title: '提示框',				
			  icon:0,		
			  }) 
			
			}else{
		    //获取input标签（快递号）的值
            var logisticsId = $('#form-field-1').val();
            //获取快递选择的值
            var logisticstypeId = $('#logisticstypeId').val();
            //执行ajax
                $.getJSON(
                    //访问页面
                    "wlcDoDeliverGoods",
                    //携带参数
                    {"orderId":id,"logisticsId":logisticsId,"logisticstypeId":logisticstypeId},
                    function (flag) {
                        if (flag){
                            layer.confirm('提交成功！',function(index){
                                $(obj).parents("tr").find(".td-manage").prepend('<a style=" display:none" class="btn btn-xs btn-success" onClick="member_stop(this,id)" href="javascript:;" title="已发货"><i class="fa fa-cubes bigger-120"></i></a>');
                                $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发货</span>');
                                $(obj).remove();
                                layer.msg('已发货!',{icon: 6,time:1000});
                            });
                            layer.close(index);
                        }else {
                            layer.alert('系统繁忙，请稍后再试！',{
                                title: '提示框',
                                icon:0,
                            })
                        }
                    }
                )

		  }
		
		}
	})
};


function doPage(pageNo,orderOther4) {
    var orderId = $("#orderId").val();
    var placeTime =$("#placeTime").val();
    $("#div1").load("/wlcGetOrderForm_off_the_stocksLoad?pageNo="+pageNo+"&orderId="+orderId+"&placeTime="+placeTime+"&orderOther4="+orderOther4);
}

function doDelete(orderId,pageNo,orderOther4) {
    var orderId1 = $("#orderId").val();
    var placeTime =$("#placeTime").val();
    if(confirm("是否真的删除")){
        $.getJSON(
            "wlcDodeleteOrderOrder",
            {"orderId":orderId},
            function (flag) {
                if (flag) {
                    layer.alert('删除成功！',{
                        title: '提示框',
                        icon:0,
                    })
                    $("#div1").load("/wlcGetOrderForm_off_the_stocksLoad?pageNo="+pageNo+"&orderId="+orderId1+"&placeTime="+placeTime+"&orderOther4="+orderOther4);
                }else{
                    layer.alert('系统繁忙，请稍后再试！',{
                        title: '提示框',
                        icon:0,
                    })
                    $("#div1").load("/wlcGetOrderForm_off_the_stocksLoad?pageNo="+pageNo+"&orderId="+orderId1+"&placeTime="+placeTime+"&orderOther4="+orderOther4);
                }
            }
        )
    }

}



</script>
